<%@ include file="../Proff/IsProff.jsp"%>
<%@ page import="java.sql.*, database.*"%>
<%
try{
            String title = request.getParameter("title");
            String descr = request.getParameter("descr");
            String obj = request.getParameter("obj");
            String req = request.getParameter("req");
            String tools = request.getParameter("tools");
            String diff = request.getParameter("diff");
            String type = request.getParameter("type");
            String keywords = request.getParameter("keywords");
            String results = request.getParameter("results");
            String comments = request.getParameter("comments");

            DBCon db = new DBCon(out);
            String status;
            if (request.getParameter("sub")!= null)
                {
                status = "pending";
            }else {
                status = "uncompleted";
                }
            if (db.insertProject(title, descr, obj, req, tools, diff, type, keywords, results, comments,status ,(String)session.getAttribute("ProfID")))
            {
                
                    
                response.sendRedirect("../Proff/index.jsp");
            }else {
                response.sendRedirect("../Proff/newProject.jsp?wrong");
            }
}
catch(SQLException e)
{
    response.sendRedirect("../connectionFailed.jsp?"+e);
}

%>
